
$(function() {
    var random = document.querySelector('.random');
    const regain = $('.regain');
    
    regain.on('click', function() {
      console.log('点击生成验证码'); 
      console.log(random);
      random.innerHTML = ranDoms(); 
    })

    $('#toSignUp').on('click', function(){
        console.log('点击了到注册');
        const str = '????';
        random.innnerHTML = str;
        console.log(random);
        $('.login_box').animate({'left': '240px'}, 400, 
            function(){
                console.log('执行了动画');
                $('.login_box').css({'display': 'none', 'left': '60px'});
                $('.register_change_box').css('display', 'none');
                $('.logIn_change_box').css('display', 'block');
                $('.register_box').css('display', 'block');
            });
    });
    $('#toLogIn').on('click', function() {
        console.log('点击了到登录');
        $('.register_box').animate({'right': '240px'}, 400, 
            function() {
                console.log('执行了动画');
                $('.register_box').css({'display': 'none','right': '60px'});
                $('.logIn_change_box').css('display', 'none');
                $('.login_box').css('display', 'block');
                $('.register_change_box').css('display', 'block');
            });
    });

    function ranDoms() {
        return Math.floor(Math.random()*(9999 - 1000 + 1)) + 1000;
    }

})